module.exports = function (sequelize, DataTypes) {
    let category = sequelize.define(
        'category', {
            category_id: {
                type: DataTypes.INTEGER(11),
                allowNull: false,
                autoIncrement: true,
                primaryKey: true
            },
            content_category: {
                type: DataTypes.STRING,
                allowNull: true
            },
            category_name: {
                type: DataTypes.STRING,
                allowNull: true
            },
            parent_category_id: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            category_level: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            creator: {
                type: DataTypes.STRING,
                allowNull: true
            },
            creat_time: {
                type: DataTypes.DATE,
                allowNull: true
            },
            updator: {
                type: DataTypes.STRING,
                allowNull: true
            },
            update_time: {
                type: DataTypes.DATE,
                allowNull: true
            },
            status: {
                type: DataTypes.INTEGER(1),
                allowNull: false
            },
            /*
            INTEGER: {
                type: DataTypes.INTEGER(11),
                allowNull: false
            },
            DATE: {
                type: DataTypes.DATE,
                allowNull: true
            },
            STRING: {
                type: DataTypes.STRING,
                allowNull: true
            },
            */
        },
        {
            tableName: 'category',
            timestamps: false
        }
    );

    return category;
};

